package com.example.basicexample;

import com.example.basicexample.service.ExampleService;
import com.example.basicexample.service.impl.OrderServiceImpl;

import javax.sql.DataSource;
import java.sql.SQLException;

public class ExampleMain {
    public static void main(String[] args) throws SQLException {
        //被Sharding-JDBC代理的datasource
        DataSource dataSource = ShardingDatabaseAndTableConfiguration.getDatasource();
        ExampleService exampleService = new OrderServiceImpl(dataSource);
        exampleService.initEnvironment();
        exampleService.processSuccess();
    }
}
